package com.projects.soundza.app.factory;

import java.util.Date;
import java.util.Map;

import com.projects.soundza.domain.Album;
import com.projects.soundza.domain.Track;

public class TrackFactory {
	// Don't set Lists, lists gets set in the classes
	// Check album's getTracks method as an example
	public static Track getTrack(Album album, double price, Date releaseDate, Map<String, String> stringValues, Map<String, Integer> intValues)
	{
		Track entity = new Track();
		entity.setAlbum(album);
		entity.setPrice(price);
		entity.setReleaseDate(releaseDate);
		
		entity.setTrackName(stringValues.get("trackName"));
		entity.setGenre(stringValues.get("genre"));	
		entity.setTrackUrl(stringValues.get("trackUrl"));
		
		entity.setTrackNumber(intValues.get("trackNumber"));
		entity.setDownvotes(intValues.get("downvotes"));
		entity.setUpvotes(intValues.get("upvotes"));
		return entity;
	}
}
